home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl760 / scnp785j.lzh / NONLIN.FIT < prev    next >
Text File  |  1992-06-21  |  871b  |  45 lines

  1. * Start Nonlinear Curve Fitter program then type this command: LOAD NONLIN.FIT
  2. *
  3. *   Read the data that is to be fit.
  4. read 6
  5. 1.68  0.172
  6. 3.33  0.25
  7. 5  0.286
  8. 6.67  0.303
  9. 10  0.334
  10. 19  0.384
  11. *
  12. *   Set the number of parameters (p1 & p2).
  13. numpar 2
  14. *
  15. *   Enter initial estimates of the parameters.
  16. p1 = 10
  17. p2 = 500
  18. *
  19. *   Enter the equation that is to be fit to the data.
  20. t1= p2 + x
  21. y(x)= p1 * x / t1
  22. *
  23. *   Enter partial derivatives of the equation with respect to the parameters.
  24. partials on
  25. dy/dp1= x / t1
  26. dy/dp2= -p1 * x / ( t1 * t1 )
  27. *
  28. *   Plot the fit using the initial parameter values;
  29. *   shows that the initial parameter values give a poor fit.
  30. wait
  31. plotfit
  32. *
  33. *   Find a better fit.
  34. fit
  35. *
  36. *   Plot the improved fit.
  37. wait
  38. plotfit
  39. *
  40. *   Output fit parameters (optionally to a printer or a file).
  41. outfit
  42. *
  43. *   Exit to DOS
  44. quit
  45.